<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增产品信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-product-add">
            <input name="uuids" th:value="${uuids}" type="hidden" id="uuids">
            <input name="orderId" th:value="${orderId}" type="hidden" id="orderId">
            <div class="form-group">    
                <label class="col-sm-3 control-label">产品名称：</label>
                <div class="col-sm-8">
                    <select name="id" class="form-control m-b" th:with="type=${@productService.getProductInfo()}">
                        <option th:each="dict : ${type}" th:text="${dict.productName}" th:value="${dict.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">产品数量：</label>
                <div class="col-sm-8">
                    <input name="productNum" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">
                <label class="col-sm-3 control-label">备注信息：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text">
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/product"
        $("#form-product-add").validate({
            focusCleanup: true,
            rules:{
                productNum:{
                    digits:true,
                    range:[1,10000]
                }
            }
        });

        function submitHandler() {
            var orderId=$("#orderId").val();
            if ($.validate.form()) {
                $.operate.save(prefix + "/addpro?orderId="+orderId, $('#form-product-add').serialize());
            }
        }
    </script>
</body>
</html>